home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Panorama / Panorama - Disk 19D (1987-07-22)(Pacific North-West Amigas Club)[WB].zip / Panorama - Disk 19D (1987-07-22)(Pacific North-West Amigas Club)[WB].adf / PipeHandler1.2 / pipebuf.h < prev    next >
C/C++ Source or Header  |  1987-06-28  |  1KB  |  38 lines

  1. /****************************************************************************
  2. **  File:       pipebuf.h
  3. **  Program:    pipe-handler - an AmigaDOS handler for named pipes
  4. **  Version:    1.1
  5. **  Author:     Ed Puckett      qix@mit-oz
  6. **
  7. **  Copyright 1987 by EpAc Software.  All Rights Reserved.
  8. **
  9. **  History:    05-Jan-87       Original Version (1.0)
  10. */
  11.  
  12.  
  13.  
  14. #define   MAX_PIPELEN   (1L << 24)
  15.  
  16.  
  17.  
  18. typedef struct pipebuf
  19.   { ULONG  head,       /* index of first character */
  20.            tail;       /* index of last character */
  21.     BYTE   full;       /* flag - takes care of full/empty ambiguity */
  22.     ULONG  len;        /* length of buffer */
  23.     BYTE   buf[1];     /* buffer proceeds from here */
  24.   }
  25. PIPEBUF;
  26.  
  27.  
  28.  
  29. #define   PipebufEmpty(pb)   (((pb)->head == (pb)->tail) && (! (pb)->full))
  30. #define   PipebufFull(pb)    (((pb)->head == (pb)->tail) && ((pb)->full))
  31. #define   FreePipebuf(pb)    (FreeMem ((pb), sizeof (PIPEBUF) - 1 + (pb)->len))
  32.  
  33.  
  34.  
  35. extern PIPEBUF  *AllocPipebuf   ( /* len */ );
  36. extern ULONG    MoveFromPipebuf ( /* pb, dest, amt */ );
  37. extern ULONG    MoveToPipebuf   ( /* pb, src, amt */ );
  38.